Skip to contents

Add polygons from an ArcGIS feature layer to a leaflet map

Usage

TADA_addPolys(map, url, layergroup, layername, bbox = NULL)

Arguments

map

A leaflet map

url

URL of the ArcGIS REST service returning the polygon feature layer

layergroup

Name of the layer group

layername

Name of the layer

bbox

A bounding box from the sf function st_bbox; used to filter the query results. Optional; defaults to NULL.

Value

The original map with polygon from the feature layer added to it.

Examples

# Create a leaflet map
lmap <- leaflet::leaflet() %>% leaflet::addProviderTiles("Esri.WorldTopoMap", group = "World topo")
# Add the American Indian Reservations feature layer to the map
lmap <- TADA:::TADA_addPolys(lmap, "https://geopub.epa.gov/arcgis/rest/services/EMEF/Tribal/MapServer/2/query", "Tribes", "American Indian Reservations")
lmap